﻿<Ribbon:RibbonWindow x:Class="Sautom.WpfClient.Views.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:prism="http://www.codeplex.com/prism"
        xmlns:Controls="clr-namespace:Sautom.WpfClient.Controls" xmlns:ClientComunication="clr-namespace:Sautom.ClientComunication;assembly=Sautom.ClientComunication"
        xmlns:Ribbon="clr-namespace:Microsoft.Windows.Controls.Ribbon;assembly=RibbonControlsLibrary" xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" xmlns:l="clr-namespace:Sautom.WpfClient.Converters"
                     xmlns:I18N="clr-namespace:Sautom.I18N;assembly=Sautom.I18N" WindowStartupLocation="CenterScreen" WindowState="Maximized"
        Height="650" Width="1000"
        Icon="../Images/PnPIcon.ico"
        mc:Ignorable="d" d:DesignHeight="720" d:DesignWidth="900" WindowStyle="SingleBorderWindow">

    <Ribbon:RibbonWindow.Resources>
        <l:NortificationTypeToSourceConverter x:Key="NortificationTypeToSourceConverter" />
    </Ribbon:RibbonWindow.Resources>
    
    <Grid x:Name="LayoutRoot">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="100*" />
        </Grid.RowDefinitions>

        <Ribbon:Ribbon Grid.Row="0" x:Name="ApplicationRibbon" prism:RegionManager.RegionName="RibbonRegion">
            <!-- Ribbon ApplicationMenu (defined here) -->
            <Ribbon:Ribbon.Background>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="#8285ABCC" Offset="0.528" />
                    <GradientStop Color="#27344476" Offset="1" />
                </LinearGradientBrush>
            </Ribbon:Ribbon.Background>
            <Ribbon:Ribbon.ApplicationMenu>
                <Ribbon:RibbonApplicationMenu SmallImageSource="..\Images\ribbon\ribbon.png">
                    <Ribbon:RibbonApplicationMenuItem Header="Exit" Command="{Binding ExitCommand}" x:Name="MenuItemExit" ImageSource="..\Images\ribbon\LargeIcon.png"/>
                </Ribbon:RibbonApplicationMenu>
            </Ribbon:Ribbon.ApplicationMenu>

            <!-- Ribbon QuickAccessToolbar  (defined here) -->

            <!--<Ribbon:Ribbon.QuickAccessToolBar>
                <Ribbon:RibbonQuickAccessToolBar>
                    <Ribbon:RibbonButton Command="{Binding NewCollection}" ToolTip="Create a new file (Ctrl+N)" SmallImageSource="..\Images\ribbon\new.png" />
                    <Ribbon:RibbonButton Command="{Binding OpenCollection}" ToolTip="Open an existing file (Ctrl+O)" SmallImageSource="..\Images\ribbon\open.png" />
                    <Ribbon:RibbonButton Command="{Binding SaveCollection}" ToolTip="Save the current file (Ctrl+S)" SmallImageSource="..\Images\ribbon\save.png" />
                    <Ribbon:RibbonButton Command="{Binding PrintNote}" ToolTip="Print the current file (Ctrl+P)" SmallImageSource="..\Images\ribbon\print.png" />
                </Ribbon:RibbonQuickAccessToolBar>
            </Ribbon:Ribbon.QuickAccessToolBar>-->

            <!-- Home Tab (defined here) -->
            <Ribbon:RibbonTab x:Name="Tab" Header="Home" DataContext="{Binding RibbonCommands}">
                <Ribbon:RibbonGroup Header="{Binding Source={x:Static I18N:ProposalResources.ProposalTaskBtn}}">
                    <Ribbon:RibbonButton LargeImageSource="..\Images\ribbon\LargeIcon.png" Label="Список программ" Command="{Binding ProposalsListCommand}" />
                    <Ribbon:RibbonButton SmallImageSource="..\Images\ribbon\SmallIcon.png" Label="{Binding Source={x:Static I18N:ProposalResources.CountriesListBtn}}" Command="{Binding CountriesListCommand}" />
                    <Ribbon:RibbonButton SmallImageSource="..\Images\ribbon\SmallIcon.png" Label="Ставки" Command="{Binding RatesListCommand}" />
                </Ribbon:RibbonGroup>
                <Ribbon:RibbonGroup Header="Clients">
                    <Ribbon:RibbonButton LargeImageSource="..\Images\ribbon\LargeIcon.png" Label="Список клиентов" Command="{Binding ClientsListCommand}" />
                    <Ribbon:RibbonButton SmallImageSource="..\Images\ribbon\SmallIcon.png" Label="{Binding Source={x:Static I18N:ClientResources.AddNewClientBtn}}" Command="{Binding AddNewClientCommand}" />
                </Ribbon:RibbonGroup>
            </Ribbon:RibbonTab>
        </Ribbon:Ribbon>
        <Controls:ModalDialogPopup IsOpen="{Binding Path=IsPopup, Mode=OneWay}">
            <Controls:ModalDialogPopup.HostedContent>
                <ContentControl>
                	<WrapPanel DataContext="{Binding Nortification}">
                        <Image Width="32" Height="32" Margin="0,0,10,0"
                               Source="{Binding NortificationType, Converter={StaticResource NortificationTypeToSourceConverter}}" />
                        <TextBlock MaxWidth="400" TextWrapping="Wrap" Text="{Binding NortificationText}" />
                    </WrapPanel>
                </ContentControl>
            </Controls:ModalDialogPopup.HostedContent>
        </Controls:ModalDialogPopup>
        <Grid Grid.Row="1">
            <Grid.RowDefinitions>
                <RowDefinition Height="500*" />
                <RowDefinition Height="350*" />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="200" />
                <ColumnDefinition Width="700*" />
            </Grid.ColumnDefinitions>
            <Grid.Background>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="#8285ABCC" Offset="0.528" />
                    <GradientStop Color="#27344476" Offset="1" />
                </LinearGradientBrush>
            </Grid.Background>

            <Controls:RegionBorderControl Style="{DynamicResource RegionBorderControlStyle}" ScrollViewer.HorizontalScrollBarVisibility="Hidden">
                <ContentControl VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch" prism:RegionManager.RegionName="{Binding Source={x:Static ClientComunication:RegionProvider.TopLeftRegion}}" />
            </Controls:RegionBorderControl>

            <!-- Task Button Region -->
            <Controls:RegionBorderControl Style="{DynamicResource RegionBorderControlStyle}" Grid.Row="1">
                <StackPanel HorizontalAlignment="Stretch">
                    <ItemsControl x:Name="TaskButtonRegion" prism:RegionManager.RegionName="{Binding Source={x:Static ClientComunication:RegionProvider.TaskButtonRegion}}" HorizontalAlignment="Stretch" VerticalAlignment="Top" />
                </StackPanel>
            </Controls:RegionBorderControl>

            <!-- Main Content Region -->
            <Controls:RegionBorderControl Style="{DynamicResource RegionBorderControlStyle}" Margin="0,2,2,2" Grid.Column="1" Grid.RowSpan="2">
                <ContentControl VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch" prism:RegionManager.RegionName="{Binding Source={x:Static ClientComunication:RegionProvider.MainRegion}}" TextElement.FontSize="14"></ContentControl>
            </Controls:RegionBorderControl>
        </Grid>
    </Grid>

</Ribbon:RibbonWindow>
